package com.example.e.Fragment

import android.annotation.SuppressLint
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import android.widget.Toast
import androidx.fragment.app.Fragment
import com.example.e.LoginActivity
import com.example.e.R
import kotlinx.android.synthetic.main.fragment_me.*
class MeFragment : Fragment(){
    var flag:String = ""
    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return inflater.inflate(R.layout.fragment_me, container, false)
    }

    @SuppressLint("SetTextI18n")
    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        //登录
        var mlogin = view.findViewById(R.id.login) as ImageView
        mlogin.setOnClickListener() {
            val intent = Intent(activity, LoginActivity::class.java)
            /*var flag1 = intent.getStringExtra("flag")
            flag = flag1.toString()*/
            startActivity(intent)
        }
        /*Toast.makeText(this,"${flag}",Toast.LENGTH_LONG).show
       if(flag.equals("登录成功")){
           mlogin.setText("用户")
       }*/
    }
}